package cn.uniqueww.javadesignpatterns.demos.design.strategy;

import org.springframework.stereotype.Component;

/**
 * 支付宝支付
 * @since 2024/1/17 11:35 上午
 *
 */
@Component
public class AliPay implements IPay{

    /**
     * 支付
     * @param amount
     * @return
     */
    @Override
    public String pay(int amount) {
        return "支付宝支付了"+amount+"元";
    }


    @Override
    public void afterPropertiesSet() throws Exception {
        PayHandler.addPay(1,this);
    }
}
